$OpenBSD: patch-src_SearchList_h,v 1.1 2016/11/23 09:56:21 dcoppa Exp $

commit a19567efa969835503823d6f6d193dcc83eb92ef
Author: upstream svn <svn@amule.org>
Date:   Mon Nov 21 10:58:27 2016 +0000

Try to find best possible keyword for Kad search

For example most user will search like this "The oxymoronaccelerator
2", which would ask the node which indexes "the". This causes higher
traffic for such nodes and makes them a viable target to attackers,
while the kad result should be the same or even better if we ask
the node which indexes the rare keyword "oxymoronaccelerator", so
we try to rearrange keywords and generally assume that the longer
keywords are rarer.

--- src/SearchList.h.orig	Fri Sep 16 09:55:06 2016
+++ src/SearchList.h	Tue Nov 22 20:17:39 2016
@@ -64,6 +64,8 @@ class CSearchList : public wxEvtHandler (public)
 
 		//! The actual string to search for.
 		wxString searchString;
+		//! The keyword selected for Kad search
+		wxString strKeyword;
 		//! The type of files to search for (may be empty), one of ED2KFTSTR_*
 		wxString typeText;
 		//! The filename extension. May be empty.
@@ -90,7 +92,7 @@ class CSearchList : public wxEvtHandler (public)
 	 * @param params The search parameters, see CSearchParams.
 	 * @return An empty string on success, otherwise an error-message.
 	 */
-	wxString StartNewSearch(uint32* searchID, SearchType type, const CSearchParams& params);
+	wxString StartNewSearch(uint32* searchID, SearchType type, CSearchParams& params);
 
 	/** Stops the current search (global or Kad), if any is in progress. */
 	void StopSearch(bool globalOnly = false);
@@ -189,7 +191,7 @@ class CSearchList : public wxEvtHandler (public)
 	typedef std::auto_ptr<CMemFile> CMemFilePtr;
 
 	/** Create a basic search-packet for the given search-type. */
-	CMemFilePtr CreateSearchData(const CSearchParams& params, SearchType type, bool supports64bit, bool& packetUsing64bit);
+	CMemFilePtr CreateSearchData(CSearchParams& params, SearchType type, bool supports64bit, bool& packetUsing64bit);
 
 
 	//! Timer used for global search intervals.
